{% extends "base.html" %}
{% load debate_tags i18n %}

{% block head-title %}<span class="emoji">❔</span>{% blocktrans %}Confirm Presets: {{ preset_title }}{% endblocktrans %}{% endblock %}
{% block page-title %}{% blocktrans %}Confirm Presets: {{ preset_title }}{% endblocktrans %}{% endblock %}

{% block page-subnav-sections %}
  <a class="btn btn-outline-primary "
     href="{% tournamenturl 'options-tournament-index' %}">
    <i data-feather="chevron-left"></i> {% trans "Back to Configuration" %}
  </a>
{% endblock %}

{% block content %}

  {% if unchanged_preferences|length > 0 %}

    {% trans "Preferences that will not change" as title %}
    {% include "preferences_state.html" with preferences=unchanged_preferences no_change=True %}

  {% endif %}

  {% trans "Preferences that will change" as title %}
  {% include "preferences_state.html" with preferences=changed_preferences %}

  <div class="card mt-3">
    <ul class="list-group list-group-flush">
      <li class="list-group-item">
        <button id="applyPresets" class="btn btn-success btn-block">
          {% blocktrans %}Apply Presets: {{ preset_title }}{% endblocktrans %}
        </button>
        <form id="applyPresetsForm" method="POST">
          {% csrf_token %}
        </form>
      </li>
    </ul>
  </div>
{% endblock content %}

{% block js %}
  {{ block.super }}
  <script>
    $(document).ready( function() {
      $("#applyPresets").click( function() {
        $("#applyPresetsForm").submit();
        return false;
      } );
    } );
  </script>
{% endblock js %}
